package com.example.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Document("comment")
public class Comment implements Serializable {
    @Id
   private Long id;
    private String content;
    private LocalDateTime publishTime;
    @Indexed(name = "userId",unique = true)
    private String userId;
    private  String nickname;
    @Field(name = "gmt_create")
    private LocalDateTime gmtCreate;
    @Field("like_num")
    private Integer likeNum;
    @Field(name = "reply_num")
    private Integer replyNum;
    private Boolean state;
    private String parentId;
    private String articleId;
}
